#include <vector>
#include <iostream>
#include <memory>
class PhysicsModel {
public:
    virtual void simulate(double timeStep) = 0;
    virtual ~PhysicsModel() {}
};
template<typename T>
class FluidDynamicsModel : public PhysicsModel {
public:
    void simulate(double timeStep) override {
        // 实现流体动力学的模拟代码
        std::cout << "FluidDynamicsModel::simulate" << std::endl;
    }
};
template<typename T>
class ParticleSystemModel : public PhysicsModel {
public:
    void simulate(double timeStep) override {
        // 实现粒子系统的模拟代码
        std::cout << "ParticleSystemModel::simulate" << std::endl;
    }
};
class SimulationSystem {
    std::vector<std::unique_ptr<PhysicsModel>> models;
public:
    void addModel(PhysicsModel* model) {
        models.emplace_back(model);
    }

    void runSimulation(double timeStep) {
        for (auto& model : models) {
            model->simulate(timeStep);
        }
    }
};
// 主函数
int main() {
    // 创建模拟系统实例
    SimulationSystem simSystem;

    // 添加流体动力学模型和粒子系统模型
    simSystem.addModel(new FluidDynamicsModel<double>());
    simSystem.addModel(new ParticleSystemModel<int>());

    // 运行模拟，时间步长设为0.01
    double timeStep = 0.01;
    std::cout << "Starting simulation with timeStep = " << timeStep << std::endl;
    simSystem.runSimulation(timeStep);
    std::cout << "Simulation completed." << std::endl;

    return 0;
}